import 'package:flutter/material.dart';



class ButtonDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final Widget flatbuttondemo = Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Theme(
          data: Theme.of(context).copyWith(
            buttonTheme: ButtonThemeData(
              textTheme: ButtonTextTheme.primary,
            ),
          ),
          child: TextButton(
            onPressed: () {},
            child: Text(
              'button',
            ),
            style: ButtonStyle(
              // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
              shape: MaterialStateProperty.all(StadiumBorder()),

              backgroundColor:
              MaterialStateProperty.all<Color>(Colors.greenAccent),
              foregroundColor: MaterialStateProperty.all<Color>(Colors.yellow),
              textStyle: MaterialStateProperty.all<TextStyle>(
                TextStyle(color: Colors.black),
              ),
              elevation: MaterialStateProperty.all(16),
            ),
          ),
        ),
        SizedBox(
          width: 16,
        ),
        TextButton.icon(
          onPressed: () {},
          label: Text('button'),
          icon: Icon(Icons.add),
          style: ButtonStyle(
            backgroundColor:
            MaterialStateProperty.all<Color>(Colors.greenAccent),
            foregroundColor: MaterialStateProperty.all<Color>(Colors.red),
            textStyle: MaterialStateProperty.all<TextStyle>(
                TextStyle(color: Colors.black)),
            elevation: MaterialStateProperty.all(2),
          ),
        ),
      ],
    );
    final Widget elevatedButtondemo = Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Theme(
          data: Theme.of(context).copyWith(
            buttonTheme: ButtonThemeData(
              textTheme: ButtonTextTheme.primary,
            ),
          ),
          child: ElevatedButton(
            onPressed: () {},
            child: Text(
              'button',
            ),
            style: ButtonStyle(
              // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
              shape: MaterialStateProperty.all(StadiumBorder()),

              backgroundColor:
              MaterialStateProperty.all<Color>(Colors.greenAccent),
              foregroundColor: MaterialStateProperty.all<Color>(Colors.yellow),
              textStyle: MaterialStateProperty.all<TextStyle>(
                TextStyle(color: Colors.black),
              ),
              elevation: MaterialStateProperty.all(16),
            ),
          ),
        ),
        SizedBox(
          width: 16,
        ),
        TextButton.icon(
          onPressed: () {},
          label: Text('button'),
          icon: Icon(Icons.add),
          style: ButtonStyle(
            backgroundColor:
            MaterialStateProperty.all<Color>(Colors.greenAccent),
            foregroundColor: MaterialStateProperty.all<Color>(Colors.red),
            textStyle: MaterialStateProperty.all<TextStyle>(
                TextStyle(color: Colors.black)),
            elevation: MaterialStateProperty.all(2),
          ),
        ),
      ],
    );
    final Widget outLineButtondemo = Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Theme(
          data: Theme.of(context).copyWith(
            buttonTheme: ButtonThemeData(
              textTheme: ButtonTextTheme.primary,
            ),
          ),
          child: OutlinedButton(
            onPressed: () {},
            child: Text(
              'button',
            ),
            style: ButtonStyle(
              // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
              shape: MaterialStateProperty.all(StadiumBorder()),

              backgroundColor:
              MaterialStateProperty.all<Color>(Colors.greenAccent),
              foregroundColor: MaterialStateProperty.all<Color>(Colors.yellow),
              textStyle: MaterialStateProperty.all<TextStyle>(
                TextStyle(color: Colors.black),
              ),
              elevation: MaterialStateProperty.all(16),
            ),
          ),
        ),
        SizedBox(
          width: 16,
        ),
        OutlinedButton.icon(
          onPressed: () {},
          label: Text('button'),
          icon: Icon(Icons.add),
          style: ButtonStyle(
            backgroundColor:
            MaterialStateProperty.all<Color>(Colors.greenAccent),
            foregroundColor: MaterialStateProperty.all<Color>(Colors.red),
            textStyle: MaterialStateProperty.all<TextStyle>(
                TextStyle(color: Colors.black)),
            elevation: MaterialStateProperty.all(2),
          ),
        ),
      ],
    );
    return Scaffold(
      appBar: AppBar(
        title: Text('button'),
        elevation: 0,
      ),
      body: Container(
        padding: EdgeInsets.all(16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            flatbuttondemo,
            elevatedButtondemo,
            outLineButtondemo,
            Container(
              width: 230,
              child: OutlinedButton(
                onPressed: () {},
                child: Text(
                  'button',
                ),
                style: ButtonStyle(
                  // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
                  shape: MaterialStateProperty.all(StadiumBorder()),

                  backgroundColor:
                  MaterialStateProperty.all<Color>(Colors.greenAccent),
                  foregroundColor:
                  MaterialStateProperty.all<Color>(Colors.yellow),
                  textStyle: MaterialStateProperty.all<TextStyle>(
                    TextStyle(color: Colors.black),
                  ),
                  elevation: MaterialStateProperty.all(16),
                ),
              ),
            ),
            Expanded(
              child: OutlinedButton(
                onPressed: () {},
                child: Text(
                  'button',
                ),
                style: ButtonStyle(
                  // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
                  shape: MaterialStateProperty.all(StadiumBorder()),

                  backgroundColor:
                  MaterialStateProperty.all<Color>(Colors.greenAccent),
                  foregroundColor:
                  MaterialStateProperty.all<Color>(Colors.yellow),
                  textStyle: MaterialStateProperty.all<TextStyle>(
                    TextStyle(color: Colors.black),
                  ),
                  elevation: MaterialStateProperty.all(16),
                ),
              ),
            ),
            Expanded(
              flex: 2,
              child: OutlinedButton(
                onPressed: () {},
                child: Text(
                  'button',
                ),
                style: ButtonStyle(
                  // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
                  shape: MaterialStateProperty.all(StadiumBorder()),

                  backgroundColor:
                  MaterialStateProperty.all<Color>(Colors.greenAccent),
                  foregroundColor:
                  MaterialStateProperty.all<Color>(Colors.yellow),
                  textStyle: MaterialStateProperty.all<TextStyle>(
                    TextStyle(color: Colors.black),
                  ),
                  elevation: MaterialStateProperty.all(16),
                ),
              ),
            ),
            Theme(

                data: Theme.of(context).copyWith(
                  buttonTheme: ButtonThemeData(
                    padding: EdgeInsets.symmetric(horizontal: 50),
                  ),
                ),
                child: ButtonBar(
                  overflowButtonSpacing: 10,
                  buttonPadding: EdgeInsets.all(20),
                  alignment: MainAxisAlignment.start,
                  children: [

                    OutlinedButton(
                      onPressed: () {},
                      child: Text(
                        'button',
                      ),
                      style: ButtonStyle(
                        // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
                        shape: MaterialStateProperty.all(StadiumBorder()),

                        backgroundColor: MaterialStateProperty.all<Color>(
                            Colors.greenAccent),
                        foregroundColor:
                        MaterialStateProperty.all<Color>(Colors.yellow),
                        textStyle: MaterialStateProperty.all<TextStyle>(
                          TextStyle(color: Colors.black),
                        ),
                        elevation: MaterialStateProperty.all(16),
                      ),
                    ),
                    OutlinedButton(
                      onPressed: () {},
                      child: Text(
                        'button',
                      ),
                      style: ButtonStyle(
                        // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
                        shape: MaterialStateProperty.all(StadiumBorder()),

                        backgroundColor: MaterialStateProperty.all<Color>(
                            Colors.greenAccent),
                        foregroundColor:
                        MaterialStateProperty.all<Color>(Colors.yellow),
                        textStyle: MaterialStateProperty.all<TextStyle>(
                          TextStyle(color: Colors.black),
                        ),
                        elevation: MaterialStateProperty.all(16),
                      ),
                    ),
                    OutlinedButton(
                      onPressed: () {},
                      child: Text(
                        'button',
                      ),
                      style: ButtonStyle(
                        // shape:MaterialStateProperty.all(BeveledRectangleBorder(  borderRadius: BorderRadius.circular(500),)),
                        shape: MaterialStateProperty.all(StadiumBorder()),

                        backgroundColor: MaterialStateProperty.all<Color>(
                            Colors.greenAccent),
                        foregroundColor:
                        MaterialStateProperty.all<Color>(Colors.yellow),
                        textStyle: MaterialStateProperty.all<TextStyle>(
                          TextStyle(color: Colors.black),
                        ),
                        elevation: MaterialStateProperty.all(16),
                      ),
                    ),
                  ],
                ))
          ],
        ),
      ),
    );
  }
}